package com.androidx.p013lv.invention.view;

import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import androidx.fragment.app.Fragment;
import com.androidx.p013lv.base.bean.VideoBean;
import com.androidx.p013lv.base.glide.GlideUtils;
import com.androidx.p013lv.base.p015ui.LazyFragment;
import com.androidx.p013lv.invention.C1069R;

/* renamed from: com.androidx.lv.invention.view.FiveItemView */
public class FiveItemView extends LinearLayout {
    public FiveItemView(final Fragment fragment, final VideoBean videoBean, String str, int i) {
        super(fragment.getContext());
        View inflate = LayoutInflater.from(fragment.getContext()).inflate(C1069R.C1074layout.item_five_item, (ViewGroup) null);
        ImageView imageView = (ImageView) inflate.findViewById(C1069R.C1072id.iv_cover);
        TextView textView = (TextView) inflate.findViewById(C1069R.C1072id.tv_title);
        TextView textView2 = (TextView) inflate.findViewById(C1069R.C1072id.tv_score);
        TextView textView3 = (TextView) inflate.findViewById(C1069R.C1072id.tv_sum);
        ImageView imageView2 = (ImageView) inflate.findViewById(C1069R.C1072id.iv_top);
        ImageView imageView3 = (ImageView) inflate.findViewById(C1069R.C1072id.iv_pay);
        ImageView imageView4 = (ImageView) inflate.findViewById(C1069R.C1072id.iv_vip);
        ImageView imageView5 = (ImageView) inflate.findViewById(C1069R.C1072id.iv_original);
        if (videoBean.getCoverImg() == null || videoBean.getCoverImg().size() <= 0 || TextUtils.isEmpty(videoBean.getCoverImg().get(0))) {
            GlideUtils.loadCropRadiusDefault(fragment, 4, imageView);
        } else {
            GlideUtils.loadCropRadiusWh2(fragment, str + videoBean.getCoverImg().get(0), 4, imageView, 600);
        }
        textView.setText(videoBean.getTitle());
        textView2.setText(videoBean.getScore() + "分");
        textView3.setText(videoBean.getBoardData());
        if (i == 0) {
            imageView2.setImageResource(C1069R.C1071drawable.ic_top1);
        } else if (i == 1) {
            imageView2.setImageResource(C1069R.C1071drawable.ic_top2);
        } else if (i == 2) {
            imageView2.setImageResource(C1069R.C1071drawable.ic_top3);
        }
        imageView4.setVisibility(8);
        imageView3.setVisibility(8);
        if (videoBean.getVideoType() == 1) {
            imageView4.setVisibility(0);
        } else if (videoBean.getVideoType() == 2) {
            imageView3.setVisibility(0);
        }
        if (videoBean.isSelfMade()) {
            imageView5.setVisibility(0);
        } else {
            imageView5.setVisibility(8);
        }
        inflate.setOnClickListener(new View.OnClickListener() {
            /* class com.androidx.p013lv.invention.view.FiveItemView.View$OnClickListenerC11621 */

            public void onClick(View view) {
                ((LazyFragment) fragment).startVideoPlay(videoBean.getVideoId());
            }
        });
        addView(inflate);
    }
}
